<div id="middle">
    <?php if($this->session->userdata('logged_in')):?>
    <div id="contenido"><a href="<?=base_url();?>index.php/admin/eventos/crear/">Agregar evento</a>
        <table>
            <tr>
                <th>Nombre</th>
                <th>Texto</th>
                <th>Fecha</th>
                <th><?=lang('editar_noticia');?></th>
                <th><?=lang('eliminar_noticia');?></th>
            </tr>
            <?php foreach ($contenido->result() as $fila):?>
            <tr>
                <td><?=$fila->nombre?></td>
                <td><?=$fila->texto?></td>
                <td><?=date("d/m/y",$fila->fecha);?></td>
                <td><a href="<?=base_url();?>index.php/admin/noticias/editar/<?=$fila->id?>"><?=lang('editar_noticia');?></a></td>
                <td><a href="<?=base_url();?>index.php/admin/noticias/eliminar/<?=$fila->id?>"><?=lang('eliminar_noticia');?></a></td>
            </tr>
            <tr><td colspan="6"><hr /></td></tr>
            <?php endforeach;?>
        </table>
        <strong><a href="<?= site_url('/admin/admin/logout/')?>"><?=lang('salir_noticia');?></a></strong>
    </div>
    <?php else:?>
    <form action="<?= site_url('/admin/login')?>" method="post">
        <label for="login_username">Nombre:</label>
        <input type="text" id="login_username" name="login_username" value="" size="15"  /><br />
        <label for="login_password">Clave:</label>
        <input type="password" id="logine_password" name="login_password" value="" size="15" /><br />
        <input type="submit" id="login" name="login" value="Login" />
    </form>
    <?php endif;?>
</div>
